home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / HENSA / MATHS / PLPLOT / PLPLOT.ZIP / sys / amiga / old / plprefs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-16  |  1.4 KB  |  65 lines

  1. /* $Id: plprefs.c,v 1.1 1993/03/15 21:30:57 mjl Exp $
  2.    $Log: plprefs.c,v $
  3.  * Revision 1.1  1993/03/15  21:30:57  mjl
  4.  * Files shuffled around in the Amiga driver reorganization.
  5.  *
  6.  * Revision 1.2  1992/10/12  17:11:26  mjl
  7.  * Amiga-specific mods, including ANSI-fication.
  8.  *
  9.  * Revision 1.1  1992/05/20  21:35:27  furnish
  10.  * Initial checkin of the whole PLPLOT project.
  11.  *
  12. */
  13.  
  14. #include "plplot.h"
  15. #include <stdio.h>
  16. #include "plamiga.h"
  17.  
  18. struct PLPrefs PLCurPrefs;
  19.  
  20. static struct PLPrefs PLDefPrefs =
  21. {
  22.     PLCUST | PLBUFF,
  23.     PLLACE | PLHIRES,
  24.     20, 20,
  25.     300, 200,
  26.     0, 0,            /* Let ScreenChange set width and height for custom screen */
  27.     0, 0,
  28.     2,
  29.     0xCCC, 0x000, 0x00D, 0x080, 0xF00, 0xEE0, 0xE90, 0xF0F,
  30.     0x0BE, 0x090, 0x999, 0xBBB, 0xF99, 0x909, 0x0DB, 0xDDD
  31. };
  32.  
  33. void 
  34. GetPLDefs(void)
  35. {
  36.     FILE *PrefsFile;
  37.  
  38.     /* Read user preferences from s:PlPlot/PlPlot.def if it exists,
  39.        otherwise use default preferences */
  40.  
  41.     if ((PrefsFile = fopen("s:PlPlot.def", "r")) != NULL) {
  42.     (void) fread((char *) &PLDefPrefs, sizeof(struct PLPrefs), 1, PrefsFile);
  43.     (void) fclose(PrefsFile);
  44.     }
  45.     PLCurPrefs = PLDefPrefs;
  46. }
  47.  
  48. void 
  49. SetPLDefs(void)
  50. {
  51.     FILE *PrefsFile;
  52.  
  53.     if ((PrefsFile = fopen("s:PlPlot.def", "w")) != NULL) {
  54.     (void) fwrite((char *) &PLCurPrefs, sizeof(struct PLPrefs), 1, PrefsFile);
  55.     (void) fclose(PrefsFile);
  56.     }
  57.     PLDefPrefs = PLCurPrefs;
  58. }
  59.  
  60. void 
  61. RestorePrefs(void)
  62. {
  63.     PLCurPrefs = PLDefPrefs;
  64. }
  65.